export default function recursionRoutes(userMenu, allRoutes) {
  const menus = [];
  userMenu.forEach((menu) => {
    allRoutes.forEach((route) => {
      if (menu.name === route.meta.name) {
        if (menu.children && menu.children.length) {
          route.children = recursionRoutes(menu.children, route.children);
        }
        menus.push(route);
      }
    });
  });
  return menus;
}
